package cate.game.role.world.invite;

import cate.common.game.invite.InviteDef;
import cate.common.table.invite.row.InviteCreateRow;
import cate.game.GameBody;
import cate.game.role.world.invite.comm.InviteNumTask;
import easy.java.dev.note.NoteClass;
import easy.java.practice.errorcode.EcException;

/** 其他玩家通过我的分享的链接进入游戏（无论新老用户，无论哪个区服），
 * 则判定邀请成功，一条分享链接可多个玩家点击 */
@NoteClass(value = "邀请创角任务", detail = "无论新老用户, 一条分享链接可多个玩家点击")
public class InviteCreateTask extends InviteNumTask {

    @Override
    protected int getOperationSub() {
        return InviteDef.OPERATION_SUB_CREATE;
    }

    @Override
    protected int getRequiredNumForReward(GameBody game, int index) {
        return index;
    }

    @Override
    protected String getRewardCnf(GameBody game, int tid) {
        InviteCreateRow row = game.table.invite.create.get(tid);
        if(row == null) {
            throw new EcException("找不到第"+tid+"项InviteCreateRow");
        }
        return row.rwdCnf;
    }
}
